<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui" 
      xmlns:pe="http://primefaces.org/ui/extensions"
      xmlns:c="http://java.sun.com/jsf/composite/componentes">

 	<body> 
 	  	<ui:composition template="../resources/templates/tempCadForm.xhtml">     
     	 	
            <!--CABECALHO-->
     	 	<ui:define name="topoCad">     
				 
				<!--COMPONENTE - TITULO -->
			    <c:compTitulo  formTitulo="#{msg['page-pessoa-cad-titulo']}"  
			                   formUrlImg="#{imageBean.imgPessoa}" />  
    		</ui:define>  
    		
    		<!--CORPO-->
     	 	<ui:define name="corpoCad"> 
         		
         		<!-- FORMULARIO PRINCIPAL -->
         		<h:form id="formDados">
         		
         		     <!-- LOAD PAGE -->
		       		 <f:metadata>  
					    <f:event type="preRenderView" listener="#{pessoaBean.loadPage}"></f:event>  
					 </f:metadata>  
         		
         		     <!--FOCUS INCIAL -->
                     <p:focus context="panelDados"/>
                     
                     <!--MESSAGES -->
                     <p:growl id="growl" showDetail="true" escape="false" autoUpdate="true" life="#{applicationBean.timeGrowl}"/> 
         		   
         		     <p:panelGrid id="panelDados" styleClass="panel-grid">          
         		                                          

                            <!-- NOME -->  
                            <p:row>   
                              <p:column styleClass="panel-grid-cad-coluna-cel">  
                                 <h:outputLabel  value="#{msg['page-pessoa-cad-nome']}"
                                                 styleClass="panel-grid-cad-coluna-cel-text"/>
                              </p:column>  
                              <p:column styleClass="panel-grid-coluna-dados">  
                                 <c:compInputText isOnlyRead="#{pessoaBean.isOnlyRead}" 
                                              	   textValue="#{pessoaBean.pessoa.nome}"
                                                  textSize="50"
                                                  textMaxLength="100"/>
                              </p:column>
                            </p:row>
                                 

                            <!-- DATANASCIMENTO -->  
                            <p:row>   
                              <p:column styleClass="panel-grid-cad-coluna-cel">  
                                 <h:outputLabel  value="#{msg['page-pessoa-cad-datanascimento']}"
                                                 styleClass="panel-grid-cad-coluna-cel-text"/>
                              </p:column>  
                              <p:column styleClass="panel-grid-coluna-dados">  
                                 <c:compInputDate isOnlyRead="#{pessoaBean.isOnlyRead}" 
                                                  textValue="#{pessoaBean.pessoa.dataNascimento}"/>
                              </p:column>
                            </p:row>
                                 

                            <!-- SEXO -->  
                            <p:row>   
                              <p:column styleClass="panel-grid-cad-coluna-cel">  
                                 <h:outputLabel  value="#{msg['page-pessoa-cad-sexo']}"
                                                 styleClass="panel-grid-cad-coluna-cel-text"/>
                              </p:column>  
                              <p:column styleClass="panel-grid-coluna-dados">  
                                 <c:compSelectOneMenu value="#{pessoaBean.pessoa.sexo}" 
                                                      valueLabel="#{pessoaBean.pessoa.sexo.descricao}" 
                                                      listItems="#{sexoBean.listSexo.getListDomain()}" 
                                       			      listItemLabel="#{item.descricao}" 
                                       			      listItemValue="#{item}" 
                                       			      converter="#{sexoConverter}" 
                                                      isOnlyRead="false" 
                                      				  isSelectOne="true" 
                                      				  isFilter="true"> 
                                 </c:compSelectOneMenu>

                              </p:column>
                            </p:row>
  		                  
	                 </p:panelGrid> 
	                 
	                 <div class="div-espaco-2"/>
	                 <div class="div-h-linha"/>
	                 
                     <h:panelGrid columns="3" styleClass="panel-grid">
                          <p:commandButton rendered="#{!pessoaBean.isOnlyRead}" value="#{msg['btn-value-salvar']}" 
                                           update="formDados" styleClass="ui-priority-primary" 
                                   		   action="#{pessoaBean.salvar}" style="width:100%"/>     
                          <p:commandButton  value="#{msg['btn-value-sair']}" action="#{pessoaBean.sair}" immediate="true" />
        		     </h:panelGrid>  
         		</h:form>  		  
    		</ui:define>  
    	 </ui:composition> 
  	</body> 
</html>



